package sctu.edu.java.year2016.team05.lizixin.day20160529.chapter8_3;

import sctu.edu.java.year2016.team08.yangying.day20160527.chapter7_1.S;

/**
 * Created by home on 2016/5/30.
 * 尝试创建一个父类和和子类，分别创建构造方法，然后向父类和子类添加成员变量和方法，并总结构建子类对象时的顺
 */


//创建一个父类
public class Animal {
    String jump;

    public Animal() {


    }

    public void cry() {
        System.out.println("动物发出叫声");
    }
}
//创建一个子类
class dog extends Animal {
    public dog(String Jump) {
        this.jump = Jump;


    }

    public void cry() {
        System.out.println("狗发出汪汪叫声");

    }
}

class Home {
    public static void main(String[] args) {
        dog one = new dog("跳");
        System.out.println("执行one.cry后的结果");
        one.cry();
        System.out.println("狗能够" + one.jump);


    }
}
